<?php
  error_reporting(0);
  session_start();
  if($_SESSION["autenticado"]!=1 ||
     ($_POST["pago"] == "" && $_POST["entrega"] == "") ||
     $_POST["id"] == ""){
    header("Location: index.php");
  }

  include_once("fachadaBD.php");
  $f = new fachadaBD();
  if ($_POST["pago"] != ""){
    $f->cambiarPago($_POST["id"],$_POST["pago"]);
  }
  else{
    $f->cambiarEntrega($_POST["id"],$_POST["entrega"]);
  }
  $f->cerrar();
  header("Location: PanelUsuario.php");
?>
